package com.nav.brainfuckeditor.editors;

import org.eclipse.jface.text.rules.*;

public class BFPartitionScanner extends RuleBasedPartitionScanner {
	public final static String BF_OPEN = "__bf_open";
	public final static String BF_CLOSE = "__bf_close";
	public final static String BF_INPUT = "__bf_input";
	public final static String BF_OUTPUT = "__bf_output";
	public final static String BF_INCREASE = "__bf_increase";
	public final static String BF_DECREASE = "__bf_decrease";
	public final static String BF_LEFT = "__bf_left";
	public final static String BF_RIGHT = "__bf_right";
	public BFPartitionScanner() {
		IPredicateRule[] rules = new IPredicateRule[8];
		rules[0] = new SingleCharRule(IBFCharConstants.BF_OPEN, new Token(BF_OPEN));
		rules[1] = new SingleCharRule(IBFCharConstants.BF_CLOSE, new Token(BF_CLOSE));
		rules[2] = new SingleCharRule(IBFCharConstants.BF_INPUT, new Token(BF_INPUT));
		rules[3] = new SingleCharRule(IBFCharConstants.BF_OUTPUT, new Token(BF_OUTPUT));
		rules[4] = new SingleCharRule(IBFCharConstants.BF_INCREASE, new Token(BF_INCREASE));
		rules[5] = new SingleCharRule(IBFCharConstants.BF_DECREASE, new Token(BF_DECREASE));
		rules[6] = new SingleCharRule(IBFCharConstants.BF_LEFT, new Token(BF_LEFT));
		rules[7] = new SingleCharRule(IBFCharConstants.BF_RIGHT, new Token(BF_RIGHT));
		setPredicateRules(rules);
	}
}
